Skip to content

feat(cosim): add network step harness and worker - #4

Merged
deluxe2 merged 1 commit into
mainfrom
feature/cosim-network-step-harness
Nov 12, 2026
Merged

deluxe2 merged 1 commit into
mainfrom
feature/cosim-network-step-harness

Conversation

@slhck

@slhck slhck commented Nov 12, 2026

Copy link
Copy Markdown
Collaborator

This PR adds the co-simulation adapter that the VQEG CAP–CSP pilot uses to run SFV sessions against FikoRE. The adapter lived in the pilot repository and called SFV controller internals directly. Each change to those internals, such as the CAP report drain in #3, needed matching pull requests in both repositories. With the adapter in SFV, the JSON lines protocol is the only interface between the two.

The PR adds:

  • src/cosim/SFVNetworkStepHarness.js, which runs one controller per UE on a shared clock, applies CSP snapshots when they change and drains CAP reports
  • src/cosim/SFVExternalTransport.js, which maps requests and aborts to opaque submit and cancel actions
  • scripts/cosim-network-step-worker.mjs, the stdin/stdout process the pilot starts
  • docs/CO_SIMULATION.md, which describes the messages
  • five tests in test/cosim-network-step-harness.test.js

The code is the pilot's, apart from imports and the class name. It is based on GenericNetworkHarness.js and SFVExternalTransport.js from SFV-VQEG-CAP-CSP-Collaboration-Experiments v0.7.2.

Testing

  • npm test: 186 passed
  • npm run lint and npm run format:check: clean
  • The pilot ran its C1, stall, swipe and L3 example runs with this worker. Session records, network steps, shared state, telemetry and KPIs were byte-identical to the runs with its own copy.

Once this is merged, the pilot will pin the merge commit and delete its copy.

@slhck

slhck commented Nov 12, 2026

Copy link
Copy Markdown
Collaborator Author

@deluxe2 Please check if this works for you, it's basically a port of the existing instrumentation code from the CAP/CSP repo to your repo, because it talks with player internals, and that way, we can more cleanly separate the concerns.

Move the co-simulation adapter from the VQEG CAP-CSP pilot into SFV so
that the JSON lines protocol is the only interface between the two
repositories. Changes to controller internals, such as the CAP report
drain, no longer need coordinated pull requests in both.

- src/cosim/SFVNetworkStepHarness.js runs one controller per UE on a
  shared clock, applies CSP snapshots on change and drains CAP reports
- src/cosim/SFVExternalTransport.js maps requests and aborts to opaque
  submit and cancel actions
- scripts/cosim-network-step-worker.mjs is the stdin/stdout process
- docs/CO_SIMULATION.md describes the messages

The code is unchanged apart from imports, the class name and the
removed drainCapReports guard, which only made sense across repos.
@slhck
slhck force-pushed the feature/cosim-network-step-harness branch from baca32d to 5f5ae83 Compare November 12, 2026 08:17
@deluxe2

deluxe2 commented Nov 12, 2026

Copy link
Copy Markdown
Collaborator

Yeah, this totally works for me 👍 I like the new interface between player and the CAP/CSP code.

@deluxe2
deluxe2 merged commit 92386ae into main Nov 12, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants